import request from '@/utils/request'

// 查询设备告警列表
export function listAlarm(query) {
  return request({
    url: '/iot/alarm/list',
    method: 'get',
    params: query
  })
}
export function getTopic() {
  return request({
    url: '/iot/alarm/getTopic',
    method: 'get',
  })
}
export function getUser(topicId,groupId) {
  return request({
    url: '/iot/alarm/getUser/'+topicId+"/"+groupId,
    method: 'get',
  })
}

// 查询设备告警详细
export function getAlarm(alarmId) {
  return request({
    url: '/iot/alarm/' + alarmId,
    method: 'get'
  })
}

// 新增设备告警
export function addAlarm(data) {
  return request({
    url: '/iot/alarm',
    method: 'post',
    data: data
  })
}

// 修改设备告警
export function updateAlarm(data) {
  return request({
    url: '/iot/alarm',
    method: 'put',
    data: data
  })
}

// 删除设备告警
export function delAlarm(alarmId) {
  return request({
    url: '/iot/alarm/' + alarmId,
    method: 'delete'
  })
}
